<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>iframe</title>
</head>
<body>
  <p>本页面http://www.example.com/a1.html,无法访问跨域的iframe</p>
	<div id="result"></div>
	<iframe src="http://jsonplaceholder.typicode.com/posts/1" frameborder="0" onload="getContent()" name="hideframe"></iframe>
	<script type="text/javascript">
		function getContent() {
			var iframe = document.getElementsByName("hideframe")[0];
			if(iframe) {
				// 无法访问iframe.contentDocument 属于跨域
				var content = iframe.contentDocument.body.innerHTML;
			}
		}
	</script>
</body>
</html>